
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h2>节点创建和追加</h2>
<ul id="north">
    <li city="沈阳" id="ning">辽宁</li>
    <li city="沈阳" id="nshan">山东</li>
    <li city="长春">吉林</li>
</ul>
<ul id="south">
    <li city="杭州" id="hang">浙江</li>
    <li city="杭州" id="sdf">浙江</li>
    <li city="杭州" id="gs">浙江</li>
    <li city="杭州" id="haasfng">浙江</li>
    <li city="杭州" id="sdfsdf">浙江</li>
</ul>
<input type="button" value="替换" onclick="f1()">
<script type="text/javascript">
function f1(){
    var ning=document.getElementById('ning');
    var hang=document.getElementById('hang');
    var south=document.getElementById('south');
    south.replaceChild(ning,hang);
}

</script>
</body>
</html>